﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Coding4Fun.Phone.Controls" 
    xmlns:Binding="clr-namespace:Coding4Fun.Phone.Controls.Binding">
    
    <Style x:Name="AppBarText" TargetType="ContentControl">
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="0" />
    </Style>
    <Style TargetType="local:RoundToggleButton">
        <Setter Property="BorderBrush" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Padding" Value="10,3,10,5"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RoundToggleButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                                <VisualState x:Name="Indeterminate"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentBody">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="Transparent" />
                    
                        <StackPanel Orientation="{TemplateBinding Orientation}">
                        

                        <Grid Width="72" Height="72" Margin="0,-10, 0, 0">
							<Ellipse
								x:Name="ButtonBackground"
								Stroke="{TemplateBinding BorderBrush}" 
								StrokeThickness="{StaticResource PhoneStrokeThickness}" 
								Fill="{TemplateBinding Background}" 
								Margin="{StaticResource PhoneTouchTargetOverhang}" />
							<Ellipse
								x:Name="ButtonForeground" 
								Fill="{TemplateBinding Foreground}" 
								Margin="{StaticResource PhoneTouchTargetOverhang}">
								<Ellipse.OpacityMask>
									<ImageBrush x:Name="OpacityImageBrush" />
								</Ellipse.OpacityMask>
							</Ellipse>
						</Grid>

                        <ContentControl 
                            x:Name="ContentBody" 
                            Margin="0"
                            Content="{TemplateBinding Content}" 
                            FontSize="{TemplateBinding FontSize}"
                            Style="{StaticResource AppBarText}"/>
                    </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:RoundButton">
        <Setter Property="BorderBrush" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
		<Setter Property="FontSize" Value="12" />
		<Setter Property="Padding" Value="10,3,10,5"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RoundButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentBody">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        <Rectangle Fill="Transparent" />
                        <StackPanel Orientation="{TemplateBinding Orientation}">

                            <Grid Width="72" Height="72" Margin="0,-10, 0, -3">
                            <Ellipse
								x:Name="ButtonBackground"
								Stroke="{TemplateBinding BorderBrush}" 
								StrokeThickness="{StaticResource PhoneStrokeThickness}" 
								Fill="{TemplateBinding Background}" 
								Margin="{StaticResource PhoneTouchTargetOverhang}" />
							<Ellipse
								x:Name="ButtonForeground" 
								Fill="{TemplateBinding Foreground}" 
								Margin="{StaticResource PhoneTouchTargetOverhang}">
								<Ellipse.OpacityMask>
									<ImageBrush x:Name="OpacityImageBrush" />
								</Ellipse.OpacityMask>
							</Ellipse>
						</Grid>
                        
						    <ContentControl 
                                x:Name="ContentBody" 
                                Content="{TemplateBinding Content}" 
                                FontSize="{TemplateBinding FontSize}"
                                Style="{StaticResource AppBarText}"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="local:ToastPrompt">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeSmall}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Overlay" Value="{StaticResource TransparentBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ToastPrompt">
					<Grid
						VerticalAlignment="{TemplateBinding VerticalAlignment}"
                        Background="{TemplateBinding Background}">
						<StackPanel 
                            VerticalAlignment="Bottom" 
							Margin="24, 32, 16, 5" 
							Orientation="{TemplateBinding TextOrientation}">
                            <StackPanel
                                Margin="0,0,16,0"
                                VerticalAlignment="Bottom"
                                Orientation="Horizontal">
                                <Image 
                                    Stretch="None"
                                    Margin="0,0,16,0"
								    Visibility="Collapsed"
								    Name="ToastImage"
                                    VerticalAlignment="Bottom"
								    Source="{TemplateBinding ImageSource}" />
                                <TextBlock 
                                    Text="{TemplateBinding Title}"
								    FontWeight="Bold"
                                    VerticalAlignment="Center"
								    Margin="0"
                                    Padding="0" />
                            </StackPanel>
                            <TextBlock 
                                Text="{TemplateBinding Message}" 
								Margin="0"
                                Padding="0" 
                                TextWrapping="{TemplateBinding TextWrapping}"
                                VerticalAlignment="Center"/>
						</StackPanel>
					</Grid>                     
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:MessagePrompt">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource PhoneChromeBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MessagePrompt">
                    <Grid VerticalAlignment="Stretch">
                        <Rectangle Fill="{StaticResource TransparentBrush}" />

                        <Border 
                            VerticalAlignment="Top" 
                            Margin="10" 
                            Background="{TemplateBinding Background}" 
                            BorderThickness="1" 
                            BorderBrush="{StaticResource PhoneForegroundBrush}">

                            <StackPanel Margin="10">
                                <TextBlock 
							        Text="{TemplateBinding Title}" 
							        Margin="0,-10,-25,10" 
							        FontSize="30" 
							        TextWrapping="Wrap" FontFamily="Segoe WP Light" />
                                <ContentPresenter Content="{TemplateBinding Body}" />
                                <StackPanel 
                                    Margin="0,10,0,0"
                                    Name="actionButtonArea"
                                    Orientation="Horizontal"
                                    HorizontalAlignment="Center" />
                            </StackPanel>

                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:PasswordInputPrompt">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource PhoneChromeBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PasswordInputPrompt">
                    <Grid>
                        <Rectangle Fill="{StaticResource TransparentBrush}" />

                        <Border 
                            VerticalAlignment="Top" 
                            Margin="10" 
                            Background="{TemplateBinding Background}" 
                            BorderThickness="1" 
                            BorderBrush="{StaticResource PhoneForegroundBrush}">

                            <StackPanel Margin="10">
                                <TextBlock 
                                    Text="{TemplateBinding Title}" 
                                    Margin="0,-10,-25,0" 
                                    FontSize="30" 
                                    TextWrapping="Wrap" FontFamily="Segoe WP Light" />
                                <TextBlock 
                                    Text="{TemplateBinding Message}" />
                                <Grid>
                                    <TextBox 
                                        Name="inputBox" 
                                        InputScope="{TemplateBinding InputScope}"
                                        Binding:TextBinding.UpdateSourceOnChange="True" />
                                </Grid>
                                <StackPanel
                                    Name="actionButtonArea"
                                    Orientation="Horizontal"
                                    HorizontalAlignment="Center" />
                            </StackPanel>

                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:InputPrompt">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource PhoneChromeBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:InputPrompt">
                    <Grid>
                        <Rectangle Fill="{StaticResource TransparentBrush}" />

                        <Border 
                            VerticalAlignment="Top" 
                            Margin="10" 
                            Background="{TemplateBinding Background}" 
                            BorderThickness="1" 
                            BorderBrush="{StaticResource PhoneForegroundBrush}">

                            <StackPanel Margin="10">
                                <TextBlock 
							        Text="{TemplateBinding Title}" 
							        Margin="0,-10,-25,0" 
							        FontSize="30" 
							        TextWrapping="Wrap" FontFamily="Segoe WP Light" />
                                <TextBlock 
                                    Text="{TemplateBinding Message}" />
                                <TextBox 
                                    Name="inputBox" 
                                    Binding:TextBinding.UpdateSourceOnChange="True"
                                    InputScope="{TemplateBinding InputScope}"
                                    Text="{TemplateBinding Value}" />
                                <StackPanel
                                    Name="actionButtonArea"
                                    Orientation="Horizontal"
                                    HorizontalAlignment="Center" />
                            </StackPanel>

                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:ProgressOverlay">
        <Setter Property="Background" Value="{StaticResource PhoneSemitransparentBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ProgressOverlay">
                    <Grid 
                        Background="{TemplateBinding Background}"
                        Name="LayoutGrid" 
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch">
                        <Grid.Resources>
                            <Storyboard x:Name="fadeOut">
                                <DoubleAnimation Duration="0:0:0.5" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutGrid" />
                            </Storyboard>
                            <Storyboard x:Name="fadeIn">
                                <DoubleAnimation Duration="0:0:0.5" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutGrid" />
                            </Storyboard>
                        </Grid.Resources>
                        <Rectangle Fill="{StaticResource TransparentBrush}" />
                        <Grid>
                            <ContentControl Content="{TemplateBinding Content}" HorizontalContentAlignment="Stretch" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
               
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:AboutPrompt">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AboutPrompt">
                    <Grid>
                        <Rectangle Fill="Transparent" />
                        <Border 
                            VerticalAlignment="Center"
		                    Width="460" Height="460"
                            Background="{StaticResource PhoneChromeBrush}"
                            BorderThickness="1" 
                            BorderBrush="{StaticResource PhoneForegroundBrush}">
                            <Grid>
                                <ContentPresenter 
                                    Content="{TemplateBinding WaterMark}" />
                                <Grid Margin="10">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <TextBlock
                                        Grid.Row="0"
                                        VerticalAlignment="Top"
								        Text="{TemplateBinding Title}" 
								        Margin="0,-10,-25,0" 
								        FontSize="56" 
								        TextWrapping="Wrap" FontFamily="Segoe WP Light" />
                                    <ScrollViewer 
                                        Grid.Row="1" 
                                        Margin="0,0,0,10">
                                        <ContentPresenter Content="{TemplateBinding Body}" />
                                    </ScrollViewer>

                                    <ContentPresenter Grid.Row="2" Content="{TemplateBinding Footer}" />
                                    
                                    <StackPanel
                                        Name="actionButtonArea"
                                        Orientation="Horizontal"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom"
                                        Grid.Row="3" />
                                    
                                    <TextBlock
                                        Grid.Row="3"
                                        Margin="0,0,10,10"
                                        VerticalAlignment="Bottom"
                                        HorizontalAlignment="Right"
								        Text="{TemplateBinding VersionNumber}" 
								        FontFamily="Segoe WP Light" />
                                </Grid>
                                
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="local:MemoryCounter">
        <Setter Property="FontFamily" Value="Courier New" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MemoryCounter">
                    <Grid VerticalAlignment="Top" HorizontalAlignment="Right">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="75"/>
                            <ColumnDefinition Width="75"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Grid.ColumnSpan="2" Fill="{StaticResource PhoneSemitransparentBrush}" />
                        
                        <TextBlock Padding="0,0,10,0" Grid.Column="0" HorizontalAlignment="Right" Text="{TemplateBinding CurrentMemory}"/>
                        <TextBlock Padding="0,0,10,0" Grid.Column="1" HorizontalAlignment="Right" Text="{TemplateBinding PeakMemory}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="local:AboutPersonItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AboutPersonItem">
                    <Grid Margin="0,11,0,0">
                        <Grid.Resources>
                            <Style x:Key="rightSide" TargetType="TextBlock">
                                <Setter Property="Grid.Column" Value="1" />
                                <Setter Property="Margin" Value="10,0,0,5" />

                            </Style>
                            <Style x:Key="leftSide" TargetType="TextBlock">
                                <Setter Property="HorizontalAlignment" Value="Right" />
                                <Setter Property="VerticalAlignment" Value="top" />
                                <Setter Property="Grid.Column" Value="0" />
                                <Setter Property="FontWeight" Value="Bold" />
                            </Style>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <TextBlock 
                            Style="{StaticResource leftSide}"  
                            Text="{TemplateBinding Role}" />
                        <StackPanel Grid.Column="1">
                            <TextBlock 
                                Name="author" 
                                Style="{StaticResource rightSide}"
                                Text="{TemplateBinding AuthorName}"
                                Visibility="Collapsed" />
                            <TextBlock 
                                Name="website" 
                                Style="{StaticResource rightSide}"
					            Text="{TemplateBinding WebSiteDisplay}" 
                                Visibility="Collapsed" />
                            <TextBlock 
                                Name="emailAddress" 
                                Style="{StaticResource rightSide}"
                                Text="{TemplateBinding EmailAddress}" 
                                Visibility="Collapsed" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:ColorSliderThumb">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ColorSliderThumb">
                    <Grid>
                        <Rectangle 
				            Stroke="Black"
                            StrokeThickness="6" />
                        <Rectangle 
				            Stroke="White"
                            StrokeThickness="3" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:ColorSlider">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ColorSlider">
                    <Grid Name="Body">
                        <Rectangle 
                            Name="SelectedColor" 
                            Fill="{TemplateBinding SolidColorBrush}" />

                        <local:SuperSlider 
							Padding="0"
                            x:Name="Slider"
                            Orientation="{TemplateBinding Orientation}"
                            Fill="Transparent"
                            Minimum="0"
                            Maximum="360" 
                            Thumb="{TemplateBinding Thumb}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:ColorPicker">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ColorPicker">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <Rectangle 
                            Margin="0,0,0,12"
                            Height="24"
			                Grid.Row="0"
                            Grid.ColumnSpan="2"
			                Fill="{TemplateBinding SolidColorBrush}" />

                        <local:ColorSlider 
                            Width="24"
                            Margin="0,0,12,0"
                            IsColorVisible="false" 
                            Thumb="{TemplateBinding Thumb}"
                            x:Name="ColorSlider" 
                            Grid.Row="2"/>

                        <Grid 
                            Name="Body"
			                Grid.Column="1"
			                Grid.Row="1">
                            <Rectangle 
                                Name="SelectedHueColor" 
                                Fill="Red" />
                            <Rectangle>
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                        <GradientStop Offset="0" Color="White"/>
                                        <GradientStop Offset="1" Color="Transparent"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle>
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,1" EndPoint="0, 0">
                                        <GradientStop Offset="0" Color="Black"/>
                                        <GradientStop Offset="1" Color="Transparent"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Grid 
                                Name="SampleSelector"
                                VerticalAlignment="Top" 
                                HorizontalAlignment="Left">
                                <Ellipse
                                    Height="22"
                                    Width="22"
                                    StrokeThickness="5" 
                                    Stroke="Black" />
                                <Ellipse 
                                    Height="24"
                                    Width="24"
                                    StrokeThickness="3" 
                                    Stroke="White" />
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:ColorHexagonPicker">
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ColorHexagonPicker">
                    <StackPanel>
                        <ContentPresenter 
                            Content="{TemplateBinding ColorBody}" />
                        <ContentPresenter 
                            Content="{TemplateBinding GreyScaleBody}" />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:SuperSlider">
        <Setter Property="Background" Value="{StaticResource PhoneChromeBrush}" />
        <Setter Property="Fill" Value="{StaticResource PhoneAccentBrush}" />
		<Setter Property="Padding" Value="0, 6, 0, 36" />
		
        <Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:SuperSlider">
					<Grid Name="Body">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition />
						</Grid.RowDefinitions>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames
													Storyboard.TargetProperty="Fill" 
													Storyboard.TargetName="ProgressRectangle">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<TextBlock 
							Text="{TemplateBinding Title}" 
							Foreground="{StaticResource PhoneSubtleBrush}"  />
						<Grid Grid.Row="1">
							<Border Margin="{TemplateBinding Padding}">
								<Grid
									Height="{TemplateBinding BarHeight}" 
									Width="{TemplateBinding BarWidth}">
									<Rectangle 
										Grid.Row="1"
										Name="BackgroundRectangle"
										Fill="{TemplateBinding Background}" />
									<Rectangle 
										Grid.Row="1"
										Name="ProgressRectangle"
										Fill="{TemplateBinding Fill}" />

									<ContentPresenter
										Grid.Row="1"
										Content="{TemplateBinding Thumb}" />
								</Grid>
							</Border>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
    </Style>
    <Style TargetType="local:TileNotification">
        <Setter Property="Background" Value="{StaticResource PhoneChromeBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}" />
        <Setter Property="Margin" Value="12"/>
        <Setter Property="Padding" Value="8,0"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="MinWidth" Value="36"/>
        <Setter Property="MinHeight" Value="36"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TileNotification">
                    <Grid>
                        <Rectangle 
						    Fill="{TemplateBinding Background}"
						    RadiusX="18"
						    RadiusY="18" />
                        <ContentControl
                            Padding="{TemplateBinding Padding}"
							Margin="0, 0, 0, 3"
                            Foreground="{TemplateBinding Foreground}"
                            Content="{TemplateBinding Content}" 
                            FontSize="{TemplateBinding FontSize}"
                            VerticalAlignment="Center" 
							HorizontalAlignment="Center" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Tile">
        <Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Tile">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter 
                            Content="{TemplateBinding Content}" />
                        <TextBlock
                            TextWrapping="{TemplateBinding TextWrapping}"
                            VerticalAlignment="Bottom"
                            Padding="12, 0"
                            Margin="0, 0, 0, 7"
                            Text="{TemplateBinding Title}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>